package com.stitch.dcslock.properties;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Data
@ConfigurationProperties(prefix = "redis.lock")
public class RedisLockProperties {
    @Value("${redis.lock.enabled}") // 是否启用
    private boolean enabled;

    @Value("${redis.lock.address}") // Redis 连接地址
    private String address;

    @Value("${redis.lock.password}") // Redis 认证密码（可选）
    private String password;

    @Value("${redis.lock.database}") // Redis 数据库索引
    private int database;

    public boolean isEnabled() {
        return enabled;
    }

    public String getAddress() {
        return address;
    }

    public String getPassword() {
        return password;
    }

    public int getDatabase() {
        return database;
    }
}
